﻿using System;

namespace Framework
{

    public class OpenUIFormInfo : IReference
    {
        
        public static OpenUIFormInfo Create(int serialId, IUIGroup uiGroup, bool pauseCoveredUIForm, object userData,UIManager.UIOpenCallback callback)
        {
            OpenUIFormInfo info = ReferencePool.Acquire<OpenUIFormInfo>();
            info.SerialId = serialId;
            info.UserData = userData;
            info.UIGroup = uiGroup;
            info.PauseCoveredUIForm = pauseCoveredUIForm;
            info.Callback = callback;
            return info;
        }

        public UIManager.UIOpenCallback Callback{ get;private set; }
        public int SerialId { get;private set; }
        public bool PauseCoveredUIForm{ get;private set; }
        public Object UserData { get; private set; }
        public IUIGroup UIGroup { get; private set; }

        public void Clear()
        {
            UIGroup = null;
            SerialId = 0;
            UserData = null;
            PauseCoveredUIForm = false;
        }
    }

}